/*
 * @(#)NoCacheInterceptor.java $version 2011. 10. 14
 * 
 * Copyright 2011 NHN Corp. All rights Reserved.
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.hangame.mbl.interceptor;

import javax.servlet.http.HttpServletResponse;

import com.opensymphony.webwork.WebWorkStatics;
import com.opensymphony.xwork.ActionInvocation;
import com.opensymphony.xwork.interceptor.Interceptor;

import com.nhncorp.lucy.web.interceptor.AbstractInterceptor;

// TODO: Auto-generated Javadoc
/**
 * The Class NoCacheInterceptor.
 * 
 * @author khpark
 */
public class NoCacheInterceptor extends AbstractInterceptor implements Interceptor, WebWorkStatics {
	
	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -4596200944048861750L;

	/* (non-Javadoc)
	 * @see com.nhncorp.lucy.web.interceptor.AbstractInterceptor#intercept(com.opensymphony.xwork.ActionInvocation)
	 */
	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		HttpServletResponse response = (HttpServletResponse)invocation.getInvocationContext().get(HTTP_RESPONSE);
		response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
		response.setHeader("Expires", "-1");
		response.setHeader("Pragma", "no-cache");

		return invocation.invoke();
	}

}
